home *** CD-ROM | disk | FTP | other *** search
/ The Mac 1996 October / The Mac (October 1996).dmg / Utilities / pppPrefFix1.1.0 / pppPrefFixScript next >
Encoding:
Text File  |  1996-02-22  |  3.7 KB  |  99 lines  |  [TEXT/ttxt]

  1. --"pppPrefFix"       
  2. --v1.1.0
  3. --By Michael D Mays
  4. --Feb. 22,1995
  5. --Copyright ©1995 by Michael D Mays    
  6. --mdmays@iadfw.net
  7. --76447.67@compuserve.com     
  8. --
  9. --I saved the script this way so that the run-only application and script would not be confused
  10. --
  11. property finderLibraryAlias : ""
  12. path to system folder as string
  13. copy result to sysFolder
  14. copy result & "System" to pathName
  15. get short version of (info for alias ((path to system folder as string) & "System"))
  16. set togExtension to result as string
  17. set togExtensionL to length of togExtension
  18. if togExtensionL > 3 then set togExtensionL to 3
  19. set togExtension to characters 1 thru togExtensionL of togExtension as string
  20. set togExtension to togExtension as number
  21. path to preferences folder as string
  22. copy result to prefFolder
  23. copy prefFolder & "PPP Preferences" to pppPref
  24. copy prefFolder & "PPP Preferences Copy" to pppPrefCopy
  25. if togExtension ≥ 7.5 then
  26.     tell application "Finder"
  27.         get path to extensions folder as string
  28.         set finderScriptExtenRef to a reference to file (result & "Finder Scripting Extension")
  29.         if not (finderScriptExtenRef exists) then
  30.             display dialog ¬
  31.                 "You need to place the extension \"Finder Scripting Extension\" in your \"Extension Folder\" in your \"System Folder\" on your startup disk to use this script.
  32.  
  33. Please place it there and Restart your computer." buttons {"Cancel"} default button "Cancel"
  34.         end if
  35.         try
  36.             select alias pppPref
  37.         on error errMsg number errNum
  38.             if errNum = -1728 then
  39.                 beep
  40.                 display dialog "You need to run MacPPP at least once before running this script. If you have something is wrong with your MacPPP. (It's not creating a preference file called 'PPP Preferences' in the 'Preference Folder' of your 'System Folder' on your startup disk.)" buttons {"Cancel"} default button "Cancel"
  41.             else
  42.                 display dialog "Ooops...  Something went wrong which I wasn't expecting. " & ¬
  43.                     "Please eMail me and include this very important code:
  44.                 
  45. " & togExtension & "." & errNum buttons ¬
  46.                     {"Click for email address"} default button "Click for email addresses"
  47.                 display dialog "mdmays@iadfw.net
  48.             -or-
  49. 76447.67@compuserve.com
  50. Please don't forget to include this code:
  51.  
  52. " & togExtension & "." & errNum & "
  53.  
  54. Thanks!" buttons {"Cancel"} default button "Cancel"
  55.             end if
  56.         end try
  57.         duplicate selection
  58.         move alias pppPref to trash
  59.         select alias pppPrefCopy
  60.         set name of selection to "PPP Preferences"
  61.     end tell
  62. else
  63.     repeat
  64.         try
  65.             set finderLib to load script finderLibraryAlias
  66.             exit repeat
  67.         on error
  68.             set finderLibraryAlias to (choose file with prompt ¬
  69.                 "Please locate the runtime library \"FinderLib\"." of type "osas")
  70.         end try
  71.     end repeat
  72.     tell finderLib
  73.         try
  74.             copyFiles from pppPref to sysFolder without warning
  75.         on error errMsg number errNum
  76.             if errNum = 1500 then
  77.                 beep
  78.                 display dialog "You need to run MacPPP at least once before running this script. If you have something is wrong with your MacPPP. (It's not creating a preference file called 'PPP Preferences' in the 'Preference Folder' of your 'System Folder' on your startup disk.)" buttons {"Cancel"} default button "Cancel"
  79.             else
  80.                 display dialog "Ooops...  Something went wrong which I wasn't expecting. " & ¬
  81.                     "Please eMail me and include this very important code:
  82.                 
  83. " & togExtension & "." & errNum buttons ¬
  84.                     {"Click for email addresses"} default button "Click for email addresses"
  85.                 display dialog "mdmays@iadfw.net
  86.             -or-
  87. 76447.67@compuserve.com
  88. Please don't forget to include this code:
  89.  
  90. " & togExtension & "." & errNum & "
  91.  
  92. Thanks!" buttons {"Cancel"} default button "Cancel"
  93.             end if
  94.         end try
  95.         moveFilesToTrash at pppPref
  96.         moveFiles from sysFolder & "PPP Preferences" to prefFolder without warning
  97.     end tell
  98. end if
  99.